package amalgame.entity;






import java.util.ArrayList;



import android.R.anim;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.app.NotificationManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Vibrator;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;

public class ListaActividad extends ListActivity{
	
	//private static Comunicacion miCom; 
	public static boolean cerrarAplicacion;
	private static boolean custom;
    public static final int MENU_SALIR= Menu.FIRST;

	
	public static boolean desconectadoDelServidor = false;
    public static boolean appRunning = false;
	public static boolean islogueado = false;
	public static int sat_count;

	public static boolean enviarLoginDesconectado ;
	public static int NOTIFICATION = android.R.string.yes;
	public static NotificationManager mNM;
    public String TAG = "ACTIVIDAD";
    Intent intent;
    private int i  = 0;
    public static String usuarioActivo="";    
    public static String aux_banderas = "";
    
   // public static ArrayList<Coche> ArrayList_coches;


    
    public static boolean isPathActive = false;

	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		//miCom = new Comunicacion(this);

		//final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		super.onCreate(savedInstanceState);
				if (!isTaskRoot()) {
				    final Intent intent = getIntent();
				    final String intentAction = intent.getAction(); 
				    if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null && intentAction.equals(Intent.ACTION_MAIN)) {
				        Log.i(TAG, "Main Activity is not the root.  Finishing Main Activity instead of launching.");
				        finish();
				        return;       
				    }
				}

				

	
		//getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.bg3));
		//custom = customTitleSupported;
		
       	 
					
	}


	@Override
	public void setContentView(int id) {
		super.setContentView(id);		
		//setTitle();
	}
	
	@SuppressWarnings("null")
	public static void ActivarMenuItem(int Opsel){				
		MenuItem menu = null;
		switch (Opsel) {					
			case MENU_SALIR:
				((MenuItem) menu).setEnabled(true);
				break;
			
		}
	}
	
	public void setTitle(){
		//if ( custom )
		//	getWindow().setFeatureInt(Window.FEATURE_NO_TITLE, 0);
	    //    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.);
	
			
	}
	
	
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();   	
	}
	
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
	      // menu.add(0, MENU_SALIR, 0, getResources().getString(R.string.volver)).setIcon(android.R.drawable.ic_lock_power_off);
	      // menu.add(0, MENU_INFOCEL, 0,  getResources().getString(R.string.estado)).setIcon(R.drawable.mobilephone);	      	       
	       return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem menu) {
		Intent intent;
			switch (menu.getItemId()) {			
				case MENU_SALIR:
					finish();
					return true;					
			}
			return false;
		}
	
}
